package com.jt.yygh.common.config;

import com.jt.yygh.common.exception.BizServiceException;
import com.jt.yygh.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author jiang tao
 * @date 2022/3/1
 * @description:
 **/
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(value = {BizServiceException.class})
    public Result BizServiceException(BizServiceException e){
        log.info("BizServiceException:{}", e.getErrMsg());
        return Result.fail(201, e.getErrMsg());
    }

}
